iT邦幫忙

2022 iThome 鐵人賽

DAY 18
0

pip install keyboard
import keyboard

keyboard.press_and_release('shift+s, space')

keyboard.write('The quick brown fox jumps over the lazy dog.')

keyboard.add_hotkey('ctrl+shift+a', print, args=('triggered', 'hotkey'))

Press PAGE UP then PAGE DOWN to type "foobar".
keyboard.add_hotkey('page up, page down', lambda: keyboard.write('foobar'))

Blocks until you press esc.
keyboard.wait('esc')

Record events until 'esc' is pressed.
recorded = keyboard.record(until='esc')

Then replay back at three times the speed.
keyboard.play(recorded, speed_factor=3)

Type @@ then press space to replace with abbreviation.
keyboard.add_abbreviation('@@', 'my.long.email@example.com')

Block forever, like while True.
keyboard.wait()


上一篇
模擬鋼琴
下一篇
演奏鋼琴曲
系列文
讓python 解決麻煩事20
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言